
import axios from 'axios';

/**
 * 销售订单结算
 */
export class SaleOrderSettlementService {
    // 分页查询列表
    static findSaleOrderSettlements (queryParams) {
        return axios({
            url: '/restaurant/sale/SaleOrderSettlement/findSaleOrderSettlements',
            method: 'POST',
            data: queryParams
        });
    }

    //根据ID查询指定的销售订单结算
    static findSaleOrderSettlement (saleOrderSettlementId) {
        const query = {
            saleOrderSettlementId
        }
        return axios({
            url: '/restaurant/sale/SaleOrderSettlement/findSaleOrderSettlement',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的销售订单结算(包含外键名称)
    static findSaleOrderSettlementForView (saleOrderSettlementId) {
        const query = {
            saleOrderSettlementId
        }
        return axios({
            url: '/restaurant/sale/SaleOrderSettlement/findSaleOrderSettlementForView',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的销售订单结算(包含外键名称)
    static findSaleOrderSettlementForEdit (saleOrderSettlementId) {
        const query = {
            saleOrderSettlementId
        }
        return axios({
            url: '/restaurant/sale/SaleOrderSettlement/findSaleOrderSettlementForEdit',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的销售订单结算(只提取ID 和 Name)
    static findSaleOrderSettlementsWithIdNameById (saleOrderSettlementId) {
        const query = {
            saleOrderSettlementId
        }
        return axios({
            url: '/restaurant/sale/SaleOrderSettlement/findSaleOrderSettlementsWithIdNameById',
            method: 'POST',
            params: query,
        });
    }

    //根据名称查询销售订单结算集合(只提取ID 和 Name)
    static findSaleOrderSettlementsWithIdNameByName (saleOrderSettlementName) {
        const query = {
            saleOrderSettlementName
        }
        return axios({
            url: '/restaurant/sale/SaleOrderSettlement/findSaleOrderSettlementsWithIdNameByName',
            method: 'POST',
            params: query,
        });
    }

    //新增保存销售订单结算
    static saveSaleOrderSettlement (saleOrderSettlement) {
        const query = {}
        return axios({
            url: '/restaurant/sale/SaleOrderSettlement/saveSaleOrderSettlement',
            method: 'POST',
            params: query,
            data: saleOrderSettlement
        });
    }

    //修改保存销售订单结算
    static updateSaleOrderSettlement (saleOrderSettlement) {
        const query = {}
        return axios({
            url: '/restaurant/sale/SaleOrderSettlement/updateSaleOrderSettlement',
            method: 'POST',
            params: query,
            data: saleOrderSettlement
        });
    }

    //根据ID查询指定的销售订单结算(只提取ID 和 Name)
    static deleteSaleOrderSettlement (saleOrderSettlementId) {
        const query = {
            saleOrderSettlementId
        }
        return axios({
            url: '/restaurant/sale/SaleOrderSettlement/deleteSaleOrderSettlement',
            method: 'POST',
            params: query,
        });
    }

  static getMenuSaleRecordsByOrderId(orderId) {
    const query = {
      orderId
    }
    return axios({
      url: '/restaurant/sale/SaleOrderSettlement/getMenuSaleRecordsByOrderId',
      method: 'POST',
      params: query,
    });
  }
}
